

#include <fstream>

using namespace std;

class c_aritmetico  
{
public:
	c_aritmetico();

	void SetFile( fstream *file );

	void comprimir( const unsigned int low_count, const unsigned int high_count, const unsigned int total );
	void comprimir_finalizar();

	void descomprimir_iniciar();
	unsigned int descomprimirTarget( const unsigned int total );
	void descomprimir( const unsigned int low_count, const unsigned int high_count);
	unsigned long getBitsEmitidos();

protected:
	
	void SetBit( const unsigned char bit );
	
	unsigned char GetBit();
	unsigned char mBitBuffer;
	unsigned char mBitCount;

	fstream *mFile;

	unsigned int pPiso;
	unsigned int pTecho;
	unsigned int pEscala;

	unsigned int mStep;
	
	/* PARA DESCOMPRIMIR */
	unsigned int mBuffer;
	unsigned int value;

	/* Estadisticas */
	unsigned long BitsEmitidos;
	
	
};



